using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using Xeml.Document;
using Mpi.Common.Graphic;


namespace Xid.Controls
{
    public partial class OlC_ObservationCtrl : OlC_BaseCtrl
    {
        private Observation ob;

        public Observation Observation
        {
            get { return ob; }
            set 
            { 
                ob = value;
                if (ob != null)
                {
                    checkBoxDestructive.DataBindings.Add("Checked", ob, "Destructive");
                    labelGermPlasm.DataBindings.Add("Text", ob.IndividualsPool, "FqName");
                    if (ob.Individual != null)
                    {
                        labelIndividualsIdVal.DataBindings.Add("Text", ob.Individual, "Id");
                    }
                }
            }
        }


        //public Point MiddleRight
        //{
        //    get { return new Point(this.Right, this.Top+((this.Bottom - this.Top) / 2)); }
      
        //}


        public OlC_ObservationCtrl()
        {
            InitializeComponent();
            //this.SetStyle(ControlStyles.OptimizedDoubleBuffer, true);
            //this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);
            //this.SetStyle(ControlStyles.ResizeRedraw, true);
            //this.SetStyle(ControlStyles.SupportsTransparentBackColor, true);
            //this.BackColor = Color.Transparent;
        }


        //protected override void OnPaint(PaintEventArgs e)
        //{
        //    Graphics g = e.Graphics;
        //    g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;
        //    g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.AntiAlias;

            
        //    g.FillPath(Brushes.DarkSeaGreen, GraphicEffect.RoundRect(0,0,(this.Width - 1), (this.Height - 1), 4f));
        //    g.DrawPath(Pens.Black, GraphicEffect.RoundRect(0, 0, (this.Width - 1), (this.Height - 1), 4f));

        //    base.OnPaint(e);
        //}
    }
}
